﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UCenter.DataProvider;
using UCenter.Models;
using UCenter.Core.Repository;

namespace UCenter.SQLServerProvider
{
    public class TemplateRepository : RepositoryBase, ITemplateRepository
    {
        public Template GetTemplateByKey(string key)
        {
            using (RepositoryContext db = new RepositoryContext())
            {
                var template = (from t in db.GetTable<Template>()
                            where t.Key == key
                            select t).SingleOrDefault();

                return template;
            }
        }
    }
}
